-module(export_data).
-include("../measure_defs.hrl").

-export([exp/0, exp_file/1, exp_stop/0]).

exp_file(File) ->
    {ok, [Data]} = file:consult(File),
    Data2 = regression:get(Data),
    Data3 = mes_misc:get(Data2),
    output_latex_sum:format(Data3, sum),
    output_latex_sum:format(Data3, details).

exp() ->
    L = filelib:wildcard("*.dat"),
    lists:map(
        fun (File) ->
            io:format("~p...", [File]),
            exp_file(File),
            io:format("done~n", [])
        end, L).

exp_stop() ->
    exp(),
    init:stop().